package com.l024.easyandroidlib.log.config;


import com.l024.easyandroidlib.log.formatter.EasyLogStackTraceFormatter;
import com.l024.easyandroidlib.log.formatter.EasyLogThreadFormatter;
import com.l024.easyandroidlib.log.printer.EasyLogConsolePrinter;
import com.l024.easyandroidlib.log.printer.EasyLogPrinter;

/**
 * @author wu_ming_zhi_bei
 * @date 2021/1/28 21:42
 * @Notes 日志配置类
 */
public abstract class EasyLogConfig {
    public static int MAX_LEN = 512;
    public static EasyLogThreadFormatter EASY_LOG_THREAD_FORMATTER = new EasyLogThreadFormatter();
    public static EasyLogStackTraceFormatter EASY_LOG_STACK_TRACE_FORMATTER = new EasyLogStackTraceFormatter();

    public JsonParser injectJsonParser(){
        return null;
    }

    public String getGlobalTag(){
        return "EasyLog";
    }

    public boolean enable(){
        return true;
    }

    /**
     * 是否包含线程
     * @return
     */
    public boolean includeThread(){
        return true;
    }

    /**
     * 堆栈信息深度 一般前几条就可以
     * @return
     */
    public int stackTraceDepth(){
        return 2;
    }

    public EasyLogPrinter[] printers(){
        return new EasyLogPrinter[]{new EasyLogConsolePrinter()};
    }

    public interface JsonParser{
        String toJson(Object src);
    }
}
